//
//  PlayerSingleton.m
//  CatMusic
//
//  Created by dllo on 15/4/25.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "PlayerSingleton.h"
#import <AVFoundation/AVFoundation.h>

@implementation PlayerSingleton

+ (instancetype)sharePlayerSingleton
{
    static PlayerSingleton *single = nil;

    static dispatch_once_t oneToTake;
    dispatch_once(&oneToTake, ^{
        single = [[PlayerSingleton alloc] init];
        single.tryListenArr = [NSMutableArray array];
//        single.loginState = NO;
    });
    return single;
}

- (void)player:(NSURL *)url
{
    [PlayerSingleton sharePlayerSingleton].playerItem = [AVPlayerItem playerItemWithURL:url];
    [PlayerSingleton sharePlayerSingleton].player = [[AVPlayer alloc] initWithPlayerItem:[PlayerSingleton sharePlayerSingleton].playerItem];
}




@end
